-
Notifications
You must be signed in to change notification settings - Fork 25
Allow file content that looks like a checksum. #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow file content that looks like a checksum. #170
Conversation
|
I'll correct the new rubocop offense. |
|
@bastelfreak Should I add some tests ? |
Currently, if a file has a content attribute set to something that looks like a checksum, it will display a deprecation warning and then probably throw an error, as the checksum-link string won't match anything in filebuckets. This code is apparently intended to allow a checksum to be passed instead of actual content, with the effect of replacing file content if it doesn't match the checksum. It appears that this mecanism is replaced by "static catalogs" and was scheduled for removal in Puppet 7. As it is no longer documented (because deprecated), it is surprising to stumble upon the behavior by just having file content that looks like a checksum. I had to work around this in a real usecase involving some proprietary software that uses the same syntax for value to be encrypted at startup. This commit introduces a new setting "use_checksum_in_file_content" that default to true, preserving current behavior. If set to false, it will never look for checksums in file contents. This setting should probably be set to false by default in the next major release.
This is a bit less nice because the nested if allowed another comment, but hey, Rubocop.
f8bdf9a to
a9ca544
Compare
|
in all honesty, this was deprecated seven years ago and I've never seen anyone actually use it. I vote we just remove the functionality. |
OK, I'll update this PR to remove the functionality instead of adding another config item :-) |
It was possible, in the distant past, to set a file's content to a checksum and have Puppet automagically fetch file content from filebucket. This functionality is long deprecated, and was once scheduled for removal in Puppet 7. I'm not even sure it's working today. This commit disables the functionality entirely.
|
Let's hope I didn't let tests for the functionality slip through... We'll see soon enough I guess 😅 |
This pull request is intended to fix #169 . Also this is my first pull request on github.
Currently, if a file has a content attribute set to something that looks like a checksum, it will display a deprecation warning and then probably throw an error, as the checksum-like string won't match anything in filebuckets.
This code is apparently intended to allow a checksum to be passed instead of actual content, with the effect of replacing file content if it doesn't match the checksum. It appears that this mecanism is replaced by "static catalogs" and was scheduled for removal in Puppet 7.
As it is no longer documented (because deprecated), it is surprising to stumble upon the behavior by just having file content that looks like a checksum. I had to work around this in a real usecase involving some proprietary software that uses the same syntax for values to be encrypted at startup.
This commit introduces a new setting "use_checksum_in_file_content" that default to true, preserving current behavior. If set to false, it will never look for checksums in file contents.
This setting should probably be set to false by default in the next major release.